<!--  -->
<script setup>
import { ref, reactive, toRefs,defineProps, onBeforeMount, onMounted, watchEffect, computed } from 'vue' // eslint-disable-line
import { useStore } from 'vuex'
import { useRoute, useRouter } from 'vue-router'
import SelectColor from './components/SelectColor.vue'
/**
* 仓库
*/
const store = useStore() // eslint-disable-line
/**
* 路由对象
*/
const route = useRoute() // eslint-disable-line
/**
* 路由实例
*/
const router = useRouter() // eslint-disable-line
// 1-开始创建组件-setup
/**
* Props
*/
const props = defineProps({}) // eslint-disable-line
/**
* 数据部分
*/
const selectColorVisible = ref(false)
const handleSetTheme = command => {
  selectColorVisible.value = true
}
const data = reactive({}) // eslint-disable-line
// 2.组件挂载页面之前执行----onBeforeMount
onBeforeMount(() => {})
// 3.-组件挂载到页面之后执行-------onMounted
onMounted(() => {})
watchEffect(() => {})
// 使用toRefs解构
// let { } = { ...toRefs(data) } // eslint-disable-line

</script>
<template>
  <!-- 主题图标
  v-bind：https://v3.cn.vuejs.org/api/instance-properties.html#attrs -->
  <el-dropdown
    v-bind="$attrs"
    trigger="click"
    class="theme"
    @command="handleSetTheme"
  >
    <div>
      <el-tooltip :content="$t('msg.navBar.themeChange')">
        <svg-icon icon="change-theme" />
      </el-tooltip>
    </div>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item command="color">
          {{ $t('msg.theme.themeColorChange') }}
        </el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
  <!-- 展示弹出层 -->
   <!-- 展示弹出层 -->
   <div>
    <select-color v-model="selectColorVisible"></select-color>
  </div>
</template>

<style scoped lang='scss'>
</style>
